package com.dc.commons.persistence;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.MappedSuperclass;

import com.dc.commons.persistence.able.OperatorAble;
import com.dc.commons.persistence.embeddable.Member;
import com.dc.commons.status.DataStatus;

/*******************************************************************************<P>
 * 文件名: OperatorEntity.java <br>
 * 版本: 1.0<br>
 * 描述:<br>
 * 版权所有: <br>
 * <P>
 * 创建者: 王建栋 <br>
 * 创建日期: 2015年12月21日 下午11:48:56<br>
 * 修改者: <br>
 * 修改日期: <br>
 * 修改说明: <br>
 ******************************************************************************/
@MappedSuperclass
public abstract class OperatorEntity extends BaseEntity implements OperatorAble{

	/**
	 * 创建人
	 */
	private Member createKey;
	/**
	 * 创建日期
	 */
	private Date createDate;
	/**
	 * 最后修改人
	 */
	private Member updateKey;
	/**
	 * 最后修改时间
	 */
	private Date updateDate;
	/**
	 * 数据状态
	 */
	private DataStatus dataStatus;
	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#setCreateKey(com.dc.commons.persistence.embeddable.Persion)
	 */
	@Override
	public void setCreateKey(Member createkey) {
		this.createKey=createkey;
		
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#getCreateKey()
	 */
	@AttributeOverrides({
		@AttributeOverride(name=Member.CODE,column=@Column(name="CREATE_KEY",length=50,updatable=false))
	})
	@Override
	public Member getCreateKey() {
		return this.createKey;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#setCreateDate(java.util.Date)
	 */
	@Override
	public void setCreateDate(Date createDate) {
		this.createDate=createDate;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#getCreateDate()
	 */
	@Override
	public Date getCreateDate() {
		return this.createDate;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#setUpdateKey(com.dc.commons.persistence.embeddable.Persion)
	 */
	@Override
	public void setUpdateKey(Member updateKey) {
		this.updateKey=updateKey;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#getUpdateKey()
	 */
	@AttributeOverrides({
		@AttributeOverride(name=Member.CODE,column=@Column(name="UPDATE_KEY",length=50))
	})
	@Override
	public Member getUpdateKey() {
		return this.updateKey;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#setUpdateDate(java.util.Date)
	 */
	@Override
	public void setUpdateDate(Date updateDate) {
		this.updateDate=updateDate;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.OperatorAble#getUpdateDate()
	 */
	@Override
	public Date getUpdateDate() {
		return this.updateDate;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.DataStatusAble#setDataStatus(com.dc.commons.status.DataStatus)
	 */
	@Override
	public void setDataStatus(DataStatus dataStatus) {
		this.dataStatus=dataStatus;
	}

	/* (non-Javadoc)
	 * @see com.dc.commons.persistence.able.DataStatusAble#getDataStatus()
	 */
	@Override
	@Enumerated(EnumType.STRING)
	public DataStatus getDataStatus() {
		return this.dataStatus;
	}

}
